Optimal. Leaf size=103 \[ \frac {(b c-a d)^2 \log (c \cos (e+f x)+d \sin (e+f x))}{d f \left (c^2+d^2\right )}+\frac {c x (b c-a d)^2}{d^2 \left (c^2+d^2\right )}-\frac {b x (b c-2 a d)}{d^2}-\frac {b^2 \log (\cos (e+f x))}{d f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3541, 3475, 3484, 3530} \[ \frac {(b c-a d)^2 \log (c \cos (e+f x)+d \sin (e+f x))}{d f \left (c^2+d^2\right )}+\frac {c x (b c-a d)^2}{d^2 \left (c^2+d^2\right )}-\frac {b x (b c-2 a d)}{d^2}-\frac {b^2 \log (\cos (e+f x))}{d f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3484
Rule 3530
Rule 3541
Rubi steps
\begin {align*} \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx &=-\frac {b (b c-2 a d) x}{d^2}+\frac {b^2 \int \tan (e+f x) \, dx}{d}+\frac {(b c-a d)^2 \int \frac {1}{c+d \tan (e+f x)} \, dx}{d^2}\\ &=-\frac {b (b c-2 a d) x}{d^2}+\frac {c (b c-a d)^2 x}{d^2 \left (c^2+d^2\right )}-\frac {b^2 \log (\cos (e+f x))}{d f}+\frac {(b c-a d)^2 \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{d \left (c^2+d^2\right )}\\ &=-\frac {b (b c-2 a d) x}{d^2}+\frac {c (b c-a d)^2 x}{d^2 \left (c^2+d^2\right )}-\frac {b^2 \log (\cos (e+f x))}{d f}+\frac {(b c-a d)^2 \log (c \cos (e+f x)+d \sin (e+f x))}{d \left (c^2+d^2\right ) f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.16, size = 108, normalized size = 1.05 \[ \frac {\frac {2 (b c-a d)^2 \log (c+d \tan (e+f x))}{d \left (c^2+d^2\right )}-\frac {(a-i b)^2 \log (\tan (e+f x)+i)}{d+i c}+\frac {(a+i b)^2 \log (-\tan (e+f x)+i)}{-d+i c}}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 133, normalized size = 1.29 \[ \frac {2 \, {\left (2 \, a b d^{2} + {\left (a^{2} - b^{2}\right )} c d\right )} f x + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (b^{2} c^{2} + b^{2} d^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (c^{2} d + d^{3}\right )} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.03, size = 126, normalized size = 1.22 \[ \frac {\frac {2 \, {\left (a^{2} c - b^{2} c + 2 \, a b d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {{\left (2 \, a b c - a^{2} d + b^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} + \frac {2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d + d^{3}}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.25, size = 249, normalized size = 2.42 \[ \frac {d \ln \left (c +d \tan \left (f x +e \right )\right ) a^{2}}{f \left (c^{2}+d^{2}\right )}-\frac {2 \ln \left (c +d \tan \left (f x +e \right )\right ) a b c}{f \left (c^{2}+d^{2}\right )}+\frac {\ln \left (c +d \tan \left (f x +e \right )\right ) b^{2} c^{2}}{f \left (c^{2}+d^{2}\right ) d}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} d}{2 f \left (c^{2}+d^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a b c}{f \left (c^{2}+d^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b^{2} d}{2 f \left (c^{2}+d^{2}\right )}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) a^{2} c}{f \left (c^{2}+d^{2}\right )}+\frac {2 \arctan \left (\tan \left (f x +e \right )\right ) a b d}{f \left (c^{2}+d^{2}\right )}-\frac {\arctan \left (\tan \left (f x +e \right )\right ) b^{2} c}{f \left (c^{2}+d^{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.83, size = 123, normalized size = 1.19 \[ \frac {\frac {2 \, {\left (2 \, a b d + {\left (a^{2} - b^{2}\right )} c\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} d + d^{3}} + \frac {{\left (2 \, a b c - {\left (a^{2} - b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.60, size = 115, normalized size = 1.12 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-a^2\,1{}\mathrm {i}+2\,a\,b+b^2\,1{}\mathrm {i}\right )}{2\,f\,\left (c+d\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-a^2+a\,b\,2{}\mathrm {i}+b^2\right )}{2\,f\,\left (d+c\,1{}\mathrm {i}\right )}+\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,{\left (a\,d-b\,c\right )}^2}{d\,f\,\left (c^2+d^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.35, size = 1040, normalized size = 10.10 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________